package com.entity;

import com.mybatisflex.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 商品表 实体类。
 *
 * @author admin
 * @since 2024-05-31
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("b_goods")
public class BGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 索引
     */
    @Id(keyType = KeyType.Auto)
    private Integer id;

    /**
     * 商品名称
     */
    private String goodName;

    /**
     * 商品图片
     */
    private String imgUrl;

    /**
     * 商品单价
     */
    private BigDecimal price;

    /**
     * 商品介绍
     */
    private String intro;

    /**
     * 商品单位
     */
    private String unit;

    /**
     * 商品类型id
     */
    private Integer typeId;

    /**
     * 对应配送表的id
     */
    private Integer dId;

    @Column(ignore = true)
    private BigDecimal totalPrice;

    @Column(ignore = true)
    private Integer num;

    @RelationManyToOne(selfField = "typeId",targetField = "id")
    private BType bType;
}
